package com.menhai.personmanagement.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.menhai.personmanagement.entity.Codelist;
import com.menhai.personmanagement.entity.co.MbReportCardCO;
import com.menhai.personmanagement.entity.vo.MbReportCardVo;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author shikun
 * @since 2021-11-24
 */
@Mapper
public interface CodelistMapper extends BaseMapper<Codelist> {

    /**
     * @param kindCode
     * @describe
     * @Return java.util.List<com.menhai.personmanagement.entity.Codelist>
     * @Date 2021/11/25 8:58
     * @author shikun
     */
    List<Codelist> selectByCodeKindCode(@Param("kindCode") String kindCode);

    /**
     * @describe 医院下级
     * @param codeValue
     * @Return java.util.List<com.menhai.personmanagement.entity.Codelist>
     * @Date 2021/12/16 10:55
     * @author shikun
     */
    List<Codelist> getLowerlevel(@Param("codeValue") String codeValue);

    /**
     * 获取字典表行政区划(省)
     *
     * @return
     */
    public List<Codelist> selectProvince();


    /**
     * 获取字典表行政区划(市)
     *
     * @return
     */
    public List<Codelist> selectCity(@Param("option1") String option1, @Param("option2") String option2);


    /**
     * 获取个等级医院
     * @return
     */
    public List<Codelist> getHospital();
    public List<Codelist> getHospitalTwo(@Param("code") String code);

    public List<Codelist> getHospitalThree(@Param("code") String code);


    public List<Codelist> getZhenHospital();

    public List<Codelist> getChunHospital();

    @Select("select * from codelist where kindCode = #{kindCode}")
    public List<Codelist> findOneType(@Param("kindCode") String kindCode);


    public List<Codelist> getCodeValueByCodeName(@Param("codeName") String codename[]);
    
    /**
     * 获取镇列表
     * @param hosnum
     * @return
     */
    public List<Codelist> getZhenList(@Param("hosnum") String hosnum);
    
    /**
     * 获取村列表
     * @param hosnum
     * @return
     */
    public List<Codelist> getCunList(@Param("hosnum") String hosnum);
    
    /**
     * 获取慢病信息列表
     * @return
     */
    public List<Codelist> getChronicList();
    
    /**
     * 获取字典维护二级菜单
     * @return
     */
    public List<Codelist> getKindCodeList();
    
    /**
     * 获取字典列表
     * @param page
     * @param kindCode
     * @return
     */
    IPage<Codelist> getCodeList(@Param("page")Page<Codelist> page,@Param("codelist") Codelist codelist);
    
    /**
     * 字典插入
     */
    public int insert(Codelist codelist);


    public int updateUpnameById(Codelist codelist);

    Codelist selectOrder(@Param("codeValue")String codeValue);

    Codelist selectOrdershort(@Param("codeValue")String codeValue);

    List <Codelist> selectlikecodeValue(@Param("codeValue")String codeValue);

    List codelistBycodelistId(@Param("codeValue")String codeValue);

    List populationBycodelistId(@Param("codeValue")String codeValue);

    /**
     * 查询字典编码是否唯一
     * @param kindCode
     * @param codeValue
     * @return
     */
    public int getCountBykind(@Param("kindCode")String kindCode,@Param("codeValue")String codeValue);
    
    /**
     * 根据主键删除字典
     * @param codelistId
     * @return
     */
    public int delete(@Param("codelistId")String codelistId);
    
    /**
     * 更新字典
     * @param codelist
     * @return
     */
    public int update(Codelist codelist);
    
    /**
     * 规范人员管理统计表村
     * @param hosnum
     * @return
     */
    public List<Codelist> chronicPatientGroupsStatisticsCun(@Param("hosnum") String hosnum);
    
    /**
     * 获取文化程度
     * @return
     */
    public List<Codelist> getSTUDYHEIGHT();
}
